<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%><%@taglib
	uri="http://java.sun.com/jsf/core" prefix="f"%><%@taglib
	uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<div class="mainBackground">
			<div class="innerBackground">
<f:view locale="#{visitInfo.currentUser.locale}">
	<jsp:include page="nav.jsp"/>

	<h:form>
		<div style="outline-color:black;outline-width:1px;outline-style:solid;width:400px;margin-top:10px;">
		<h:panelGrid  columns="4" >
			<h:outputText value="工程ID"></h:outputText>
			<h:inputText value="#{applyBean.projectId}" styleClass="inputText"></h:inputText>
			<h:commandButton value="申请" action="#{applyBean.apply}" id="applyButton" styleClass="button"></h:commandButton>
				<h:messages></h:messages>
		</h:panelGrid>
		</div>
	</h:form>
		<c:forEach items="#{projectBean.userCreatedProject}" var="project" varStatus="statu">
			<div class="table" >
				<div class="tableHead">
					<h:form>
					<h:outputText value="#{project.projectName}"></h:outputText>
					</h:form>
				</div>
					<h:form>
						<h:dataTable border="0" value="#{project.applyList}" var="apply" width="800px" style="text-align: center">
							<h:column id="column1">
								<f:facet name="header">
									<h:outputText value="申请人"></h:outputText>
								</f:facet>
								<h:outputText value="#{apply.applyUser}">
									<f:converter converterId="userConverter"/>
								</h:outputText>
							</h:column>
							<h:column id="column2">
								<f:facet name="header">
									<h:outputText value="申请工程"></h:outputText>
								</f:facet>
								<h:outputText value="#{apply.applyProject}">
									<f:converter converterId="projectConverter"/>
								</h:outputText>
							</h:column>
							<h:column id="column3">
								<f:facet name="header">
									<h:outputText value="申请时间"></h:outputText>
								</f:facet>
								<h:outputText value="#{apply.applyDate}">
									<f:convertDateTime />
								</h:outputText>
							</h:column>
							<h:column id="column4">
								<f:facet name="header">
									<h:outputText value="通过/拒绝"></h:outputText>
								</f:facet>
								<h:commandLink value="通过" style="color:red;" actionListener="#{projectBean.approve}">
									<f:attribute name="applyId" value="#{apply.applyId}"/>
								</h:commandLink>
								<h:commandLink value="拒绝" style="color:green" actionListener="#{projectBean.deny}">
									<f:attribute name="applyId" value="#{apply.applyId}"/>
								</h:commandLink>
							</h:column>
						</h:dataTable>
						</h:form>
					</div>
		</c:forEach>
	</f:view>
</div>
</div>
</body>
</html>